// <copyright file="Document.cs" company="Alan Dean">
// The MIT License

// Copyright (c) 2008 Alan Dean

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// </copyright>
// <author>Alan Dean</author>
// <email>alan.dean@thoughtpad.net</email>

namespace Semantic.Rdf.Foaf
{
    using System;
    using System.Diagnostics.CodeAnalysis;
    using System.Runtime.Serialization;

    /// <summary>
    /// Represents a FOAF <see href="http://xmlns.com/foaf/spec/#term_Document">Document</see> class.
    /// <para>This class cannot be inherited.</para>
    /// </summary>
    /// 
    /// <remarks>
    /// <para>A document.</para>
    /// <para>
    /// The <see href="http://xmlns.com/foaf/spec/#term_Document">foaf:Document</see> class
    /// represents those things which are, broadly conceived, 'documents'.
    /// </para>
    /// <para>
    /// The <see cref="T:Semantic.Rdf.Foaf.Image">foaf:Image</see> class is a sub-class of foaf:Document,
    /// since all images are documents.
    /// </para>
    /// <para>
    /// We do not (currently) distinguish precisely between physical and electronic documents,
    /// or between copies of a work and the abstraction those copies embody.
    /// The relationship between documents and their byte-stream representation needs clarification
    /// (see foaf:sha1 for related issues).
    /// </para>
    /// </remarks>
    /// 
    /// <seealso href="http://xmlns.com/foaf/spec/">
    /// FOAF Vocabulary Specification
    /// </seealso>
    [Serializable]
    public class Document : Syntax.Type
    {
        #region fields

        /// <summary>
        /// Stores the <see cref="P:Semantic.Rdf.Foaf.Document.Object"/> data.
        /// </summary>
        private static readonly IUriReference _obj = new UriReference("http://xmlns.com/foaf/0.1/Document");
        
        #endregion

        #region public Document(IUriReference)
        /// <overloads>
        /// Overloaded.
        /// Initializes a new instance of the <see cref="T:Semantic.Rdf.Foaf.Document"/> class.
        /// </overloads>
        ///
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Semantic.Rdf.Foaf.Document"/> class
        /// with the specified <paramref name="subject"/>.
        /// </summary>
        ///
        /// <param name="subject">The subject of the triple.</param>
        /// 
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="subject"/> is a <see langword="null"/> reference.
        /// </exception>
        public Document(IUriReference subject)
            : base(subject, _obj)
        {
        }
        #endregion

        #region protected Document(IUriReference, IUriReference)
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Semantic.Rdf.Foaf.Document"/> class
        /// with the specified <paramref name="subject"/> and <paramref name="obj">object</paramref>.
        /// </summary>
        ///
        /// <param name="subject">The subject of the triple.</param>
        /// <param name="obj">The object of the triple.</param>
        /// 
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="subject"/> is a <see langword="null"/> reference.<br/>-or-<br/>
        /// <paramref name="obj"/> is a <see langword="null"/> reference.
        /// </exception>
        [SuppressMessage("Microsoft.Naming", "CA1720:IdentifiersShouldNotContainTypeNames", MessageId = "obj", Justification = "This is the appropriate naming.")]
        protected Document(IUriReference subject, IUriReference obj)
            : base(subject, obj)
        {
        }
        #endregion

        #region protected Document(SerializationInfo, StreamingContext)
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Semantic.Rdf.Foaf.Document"/> class
        /// from the specified instances of the <see cref="T:System.Runtime.Serialization.SerializationInfo"/>
        /// and <see cref="T:System.Runtime.Serialization.StreamingContext"/> classes.
        /// </summary>
        /// 
        /// <param name="info">
        /// An instance of the  <see cref="T:System.Runtime.Serialization.SerializationInfo"/> class
        /// containing the information required to serialize the
        /// new <see cref="T:Semantic.Rdf.BooleanLiteral"/> instance. 
        /// </param>
        /// <param name="context">
        /// An instance of the <see cref="T:System.Runtime.Serialization.StreamingContext"/> class
        /// containing the source of the serialized stream associated with the
        /// new <see cref="T:Semantic.Rdf.BooleanLiteral"/> instance.
        /// </param>
        /// 
        /// <exception cref="T:System.ArgumentNullException">
        /// <paramref name="info"/> is a <see langword="null"/> reference.
        /// </exception>
        protected Document(SerializationInfo info, StreamingContext context)
            : base(info, context)
        {
        }
        #endregion
    }
}